package com.hqq.behaviour.specification.selector;

import com.hqq.behaviour.specification.creature.Creature;
import com.hqq.behaviour.specification.property.Color;
import com.hqq.behaviour.specification.property.Size;

import java.util.function.Predicate;

/**
 * SizeSelector
 * Created by heqianqian on 2017/6/20.
 */
public class SizeSelector implements Predicate<Creature> {

    private final Size size;

    public SizeSelector(Size size) {
        this.size = size;
    }

    @Override
    public boolean test(Creature creature) {
        return creature.getSize().equals(size);
    }
}
